import Vue from 'vue'
import store from './store'
import router from './router'
import moment from 'moment'
import axios from './utils/axios'
import './element-ui-components'

import App from './App.vue'

Vue.prototype.$ELEMENT = { size: 'medium' }

Vue.config.productionTip = false

Vue.prototype.$moment = moment
Vue.prototype.$axios = axios

// 全局混入
Vue.mixin({
  methods: {
    // 格式化时间
    formatTime(timestamp, format) {
      if(timestamp) {
        return moment(timestamp*1000).format(format || 'YYYY-MM-DD HH:mm');
      }
      return '';
    }
  }
});

new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')
